var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, o) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var o in e)
              Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
          })(e, o);
      };
      return function (e, o) {
        function i() {
          this.constructor = e;
        }
        if ("function" != typeof o && null !== o)
          throw new TypeError(
            "Class extends value " + String(o) + " is not a constructor or null"
          );
        t(e, o),
          (e.prototype =
            null === o
              ? Object.create(o)
              : ((i.prototype = o.prototype), new i()));
      };
    })(),
  AXAlertView = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        (e.onLoadShopNameFn = {
          caller: e,
          code: 1315,
          method: function (t) {
            0 == t.code
              ? (WebSocketService.send({ c: 1311, d: null }),
                Alert.openText("修改成功"))
              : Alert.openText(t.msg);
          },
        }),
        (UIConfig.closeDialogOnSide = !1),
        e.pos(0, 0.5 * (Laya.stage.height - 350)),
        WebSocketService.addListener(e.onLoadShopNameFn),
        WebSocketService.addListener({
          caller: e,
          code: 1216,
          method: e.onEditNoticeFn,
        }),
        WebSocketService.addListener({
          caller: e,
          code: 1231,
          method: e.onLoadBangPaiZHuanRangFn,
        }),
        e
      );
    }
    return (
      __extends(e, t),
      (e.alertOpen = function (t) {
        null == this.alert &&
          ((this.alert = new e()), (this.alert.zOrder = 1e3)),
          this.alert.popup(!0),
          (this.node = Laya.stage.addChild(this.alert)),
          this.alert.btn_shopname_sure.on(
            Laya.Event.CLICK,
            this.alert,
            this.alert.onShopNameActionFn
          ),
          (this.alert.type = t),
          "xiugainotice" == t
            ? ((this.alert.label_com_alert_title.text = "修改公告"),
              Global.bangpaiNoticeMsg
                ? (this.alert.label_com_alert_tip.text =
                    Global.bangpaiNoticeMsg)
                : (this.alert.label_com_alert_tip.text = ""),
              (this.alert.text_modify_shopname.prompt = "请输入公告内容"))
            : "bangpaimanagerToID" == t &&
              ((this.alert.label_com_alert_title.text = "帮派转让"),
              (this.alert.label_com_alert_tip.text = "请转让人ID："),
              (this.alert.text_modify_shopname.prompt = "请输入转让人ID"));
      }),
      (e.prototype.onShopNameActionFn = function () {
        "xiugainotice" == this.type
          ? this.text_modify_shopname.text.length > 0
            ? (WebSocketService.send({
                c: 1216,
                d: {
                  id: Global.bangpaiID,
                  notice: this.text_modify_shopname.text,
                },
              }),
              this.close())
            : ToastView.toastView("请输入新公告内容")
          : "bangpaimanagerToID" == this.type
          ? this.text_modify_shopname.text.length > 0
            ? (WebSocketService.send({
                c: 1231,
                d: { id: this.text_modify_shopname.text },
              }),
              this.close())
            : ToastView.toastView("请输入新公告内容")
          : this.text_modify_shopname.text.length > 0
          ? (WebSocketService.send({
              c: 1315,
              d: { name: this.text_modify_shopname.text },
            }),
            this.close())
          : Alert.openText("请输入新摊位名字");
      }),
      (e.prototype.onLoadBangPaiZHuanRangFn = function (t) {
        ToastView.toastView("转让成功"), WebSocketService.send({ c: 1126 });
      }),
      (e.prototype.onEditNoticeFn = function (t) {
        ToastView.toastView(t.msg), WebSocketService.send({ c: 1126 });
      }),
      (e.close = function () {
        this.alert && this.alert.close();
      }),
      e
    );
  })(ui.AXAlertViewUI);
